<?php

namespace AmazonPHP\SellingPartner\Api\FulfillmentInboundApi;

use AmazonPHP\SellingPartner\AccessToken;
use AmazonPHP\SellingPartner\Configuration;
use AmazonPHP\SellingPartner\Exception\ApiException;
use AmazonPHP\SellingPartner\Exception\InvalidArgumentException;
use AmazonPHP\SellingPartner\HttpFactory;
use AmazonPHP\SellingPartner\HttpSignatureHeaders;
use AmazonPHP\SellingPartner\ObjectSerializer;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerInterface;

/**
 * Fulfillment Inbound v2024-03-20
 *
 * The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.
 *
 * The version of the OpenAPI document: 2024-03-20
 *
 * This class was auto-generated by https://github.com/OpenAPITools/openapi-generator/.
 * Do not change it, it will be overwritten with next execution of /bin/generate.sh
 */
final class FulfillmentInboundV20240320SDK implements FulfillmentInboundV20240320SDKInterface
{
    private ClientInterface $client;

    private HttpFactory $httpFactory;

    private Configuration $configuration;

    private LoggerInterface $logger;

    public function __construct(ClientInterface $client, HttpFactory $requestFactory, Configuration $configuration, LoggerInterface $logger)
    {
        $this->client = $client;
        $this->httpFactory = $requestFactory;
        $this->configuration = $configuration;
        $this->logger = $logger;
    }

    /**
     * Operation cancelInboundPlan
     *
     * cancelInboundPlan
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelInboundPlanResponse
     */
    public function cancelInboundPlan(AccessToken $accessToken, string $region, $inbound_plan_id)
    {
        $request = $this->cancelInboundPlanRequest($accessToken, $region, $inbound_plan_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'cancelInboundPlan', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'cancelInboundPlan')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'cancelInboundPlan'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'cancelInboundPlan',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'cancelInboundPlan', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'cancelInboundPlan')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'cancelInboundPlan'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'cancelInboundPlan',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelInboundPlanResponse',
            []
        );
    }

    /**
     * Create request for operation 'cancelInboundPlan'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function cancelInboundPlanRequest(AccessToken $accessToken, string $region, $inbound_plan_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling cancelInboundPlan'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.cancelInboundPlan, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.cancelInboundPlan, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.cancelInboundPlan, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/cancellation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation cancelSelfShipAppointment
     *
     * cancelSelfShipAppointment
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelSelfShipAppointmentRequest $body  The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelSelfShipAppointmentResponse
     */
    public function cancelSelfShipAppointment(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->cancelSelfShipAppointmentRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'cancelSelfShipAppointment', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'cancelSelfShipAppointment')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'cancelSelfShipAppointment'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'cancelSelfShipAppointment',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'cancelSelfShipAppointment', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'cancelSelfShipAppointment')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'cancelSelfShipAppointment'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'cancelSelfShipAppointment',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelSelfShipAppointmentResponse',
            []
        );
    }

    /**
     * Create request for operation 'cancelSelfShipAppointment'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CancelSelfShipAppointmentRequest $body  The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function cancelSelfShipAppointmentRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling cancelSelfShipAppointment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling cancelSelfShipAppointment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.cancelSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling cancelSelfShipAppointment'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentCancellation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation confirmDeliveryWindowOptions
     *
     * confirmDeliveryWindowOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to confirm the delivery window option for. (required)
     * @param string $delivery_window_option_id  The id of the delivery window option to be confirmed. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmDeliveryWindowOptionsResponse
     */
    public function confirmDeliveryWindowOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $delivery_window_option_id)
    {
        $request = $this->confirmDeliveryWindowOptionsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $delivery_window_option_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmDeliveryWindowOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmDeliveryWindowOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmDeliveryWindowOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmDeliveryWindowOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'confirmDeliveryWindowOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to confirm the delivery window option for. (required)
     * @param string $delivery_window_option_id  The id of the delivery window option to be confirmed. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function confirmDeliveryWindowOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $delivery_window_option_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'delivery_window_option_id' is set
        if ($delivery_window_option_id === null || (is_array($delivery_window_option_id) && count($delivery_window_option_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $delivery_window_option_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($delivery_window_option_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$delivery_window_option_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($delivery_window_option_id) < 36) {
            throw new InvalidArgumentException('invalid length for "$delivery_window_option_id" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 36.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $delivery_window_option_id)) {
            throw new InvalidArgumentException("invalid value for \"delivery_window_option_id\" when calling FulfillmentInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions/{deliveryWindowOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if ($delivery_window_option_id !== null) {
            $resourcePath = str_replace(
                '{' . 'deliveryWindowOptionId' . '}',
                ObjectSerializer::toPathValue($delivery_window_option_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation confirmPackingOption
     *
     * confirmPackingOption
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_option_id  Identifier of a packing option. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmPackingOptionResponse
     */
    public function confirmPackingOption(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_option_id)
    {
        $request = $this->confirmPackingOptionRequest($accessToken, $region, $inbound_plan_id, $packing_option_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'confirmPackingOption', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmPackingOption')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmPackingOption'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmPackingOption',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'confirmPackingOption', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmPackingOption')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmPackingOption'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmPackingOption',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmPackingOptionResponse',
            []
        );
    }

    /**
     * Create request for operation 'confirmPackingOption'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_option_id  Identifier of a packing option. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function confirmPackingOptionRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_option_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmPackingOption'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmPackingOption, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmPackingOption, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.confirmPackingOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'packing_option_id' is set
        if ($packing_option_id === null || (is_array($packing_option_id) && count($packing_option_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $packing_option_id when calling confirmPackingOption'
            );
        }
        if (strlen($packing_option_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$packing_option_id" when calling FulfillmentInboundApi.confirmPackingOption, must be smaller than or equal to 38.');
        }
        if (strlen($packing_option_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$packing_option_id" when calling FulfillmentInboundApi.confirmPackingOption, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $packing_option_id)) {
            throw new InvalidArgumentException("invalid value for \"packing_option_id\" when calling FulfillmentInboundApi.confirmPackingOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions/{packingOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($packing_option_id !== null) {
            $resourcePath = str_replace(
                '{' . 'packingOptionId' . '}',
                ObjectSerializer::toPathValue($packing_option_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation confirmPlacementOption
     *
     * confirmPlacementOption
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $placement_option_id  The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmPlacementOptionResponse
     */
    public function confirmPlacementOption(AccessToken $accessToken, string $region, $inbound_plan_id, $placement_option_id)
    {
        $request = $this->confirmPlacementOptionRequest($accessToken, $region, $inbound_plan_id, $placement_option_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'confirmPlacementOption', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmPlacementOption')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmPlacementOption'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmPlacementOption',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'confirmPlacementOption', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmPlacementOption')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmPlacementOption'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmPlacementOption',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmPlacementOptionResponse',
            []
        );
    }

    /**
     * Create request for operation 'confirmPlacementOption'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $placement_option_id  The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function confirmPlacementOptionRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $placement_option_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmPlacementOption'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmPlacementOption, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmPlacementOption, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.confirmPlacementOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'placement_option_id' is set
        if ($placement_option_id === null || (is_array($placement_option_id) && count($placement_option_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $placement_option_id when calling confirmPlacementOption'
            );
        }
        if (strlen($placement_option_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$placement_option_id" when calling FulfillmentInboundApi.confirmPlacementOption, must be smaller than or equal to 38.');
        }
        if (strlen($placement_option_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$placement_option_id" when calling FulfillmentInboundApi.confirmPlacementOption, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $placement_option_id)) {
            throw new InvalidArgumentException("invalid value for \"placement_option_id\" when calling FulfillmentInboundApi.confirmPlacementOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions/{placementOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($placement_option_id !== null) {
            $resourcePath = str_replace(
                '{' . 'placementOptionId' . '}',
                ObjectSerializer::toPathValue($placement_option_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation confirmShipmentContentUpdatePreview
     *
     * confirmShipmentContentUpdatePreview
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id  Identifier of a content update preview. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmShipmentContentUpdatePreviewResponse
     */
    public function confirmShipmentContentUpdatePreview(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $content_update_preview_id)
    {
        $request = $this->confirmShipmentContentUpdatePreviewRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $content_update_preview_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmShipmentContentUpdatePreview',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmShipmentContentUpdatePreview'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmShipmentContentUpdatePreview',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmShipmentContentUpdatePreviewResponse',
            []
        );
    }

    /**
     * Create request for operation 'confirmShipmentContentUpdatePreview'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id  Identifier of a content update preview. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function confirmShipmentContentUpdatePreviewRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $content_update_preview_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'content_update_preview_id' is set
        if ($content_update_preview_id === null || (is_array($content_update_preview_id) && count($content_update_preview_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $content_update_preview_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($content_update_preview_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($content_update_preview_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $content_update_preview_id)) {
            throw new InvalidArgumentException("invalid value for \"content_update_preview_id\" when calling FulfillmentInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if ($content_update_preview_id !== null) {
            $resourcePath = str_replace(
                '{' . 'contentUpdatePreviewId' . '}',
                ObjectSerializer::toPathValue($content_update_preview_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation confirmTransportationOptions
     *
     * confirmTransportationOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmTransportationOptionsRequest $body  The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmTransportationOptionsResponse
     */
    public function confirmTransportationOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $body)
    {
        $request = $this->confirmTransportationOptionsRequest($accessToken, $region, $inbound_plan_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'confirmTransportationOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmTransportationOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmTransportationOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmTransportationOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'confirmTransportationOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'confirmTransportationOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'confirmTransportationOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'confirmTransportationOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmTransportationOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'confirmTransportationOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ConfirmTransportationOptionsRequest $body  The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function confirmTransportationOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.confirmTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.confirmTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling confirmTransportationOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation createInboundPlan
     *
     * createInboundPlan
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateInboundPlanRequest $body  The body of the request to &#x60;createInboundPlan&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateInboundPlanResponse
     */
    public function createInboundPlan(AccessToken $accessToken, string $region, $body)
    {
        $request = $this->createInboundPlanRequest($accessToken, $region, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'createInboundPlan', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'createInboundPlan')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'createInboundPlan'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'createInboundPlan',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'createInboundPlan', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'createInboundPlan')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'createInboundPlan'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'createInboundPlan',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateInboundPlanResponse',
            []
        );
    }

    /**
     * Create request for operation 'createInboundPlan'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateInboundPlanRequest $body  The body of the request to &#x60;createInboundPlan&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function createInboundPlanRequest(AccessToken $accessToken, string $region, $body) : RequestInterface
    {
        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling createInboundPlan'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation createMarketplaceItemLabels
     *
     * createMarketplaceItemLabels
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateMarketplaceItemLabelsRequest $body  The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateMarketplaceItemLabelsResponse
     */
    public function createMarketplaceItemLabels(AccessToken $accessToken, string $region, $body)
    {
        $request = $this->createMarketplaceItemLabelsRequest($accessToken, $region, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'createMarketplaceItemLabels', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'createMarketplaceItemLabels')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'createMarketplaceItemLabels'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'createMarketplaceItemLabels',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'createMarketplaceItemLabels', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'createMarketplaceItemLabels')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'createMarketplaceItemLabels'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'createMarketplaceItemLabels',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateMarketplaceItemLabelsResponse',
            []
        );
    }

    /**
     * Create request for operation 'createMarketplaceItemLabels'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\CreateMarketplaceItemLabelsRequest $body  The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function createMarketplaceItemLabelsRequest(AccessToken $accessToken, string $region, $body) : RequestInterface
    {
        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling createMarketplaceItemLabels'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/labels';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generateDeliveryWindowOptions
     *
     * generateDeliveryWindowOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to generate delivery window options for. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateDeliveryWindowOptionsResponse
     */
    public function generateDeliveryWindowOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id)
    {
        $request = $this->generateDeliveryWindowOptionsRequest($accessToken, $region, $inbound_plan_id, $shipment_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateDeliveryWindowOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateDeliveryWindowOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateDeliveryWindowOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateDeliveryWindowOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generateDeliveryWindowOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to generate delivery window options for. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generateDeliveryWindowOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.generateDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generatePackingOptions
     *
     * generatePackingOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePackingOptionsResponse
     */
    public function generatePackingOptions(AccessToken $accessToken, string $region, $inbound_plan_id)
    {
        $request = $this->generatePackingOptionsRequest($accessToken, $region, $inbound_plan_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generatePackingOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generatePackingOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generatePackingOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generatePackingOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generatePackingOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generatePackingOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generatePackingOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generatePackingOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePackingOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generatePackingOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generatePackingOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generatePackingOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generatePackingOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generatePackingOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generatePackingOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generatePlacementOptions
     *
     * generatePlacementOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePlacementOptionsRequest $body  The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePlacementOptionsResponse
     */
    public function generatePlacementOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $body)
    {
        $request = $this->generatePlacementOptionsRequest($accessToken, $region, $inbound_plan_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generatePlacementOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generatePlacementOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generatePlacementOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generatePlacementOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generatePlacementOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generatePlacementOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generatePlacementOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generatePlacementOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePlacementOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generatePlacementOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GeneratePlacementOptionsRequest $body  The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generatePlacementOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generatePlacementOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generatePlacementOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generatePlacementOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generatePlacementOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling generatePlacementOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generateSelfShipAppointmentSlots
     *
     * generateSelfShipAppointmentSlots
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateSelfShipAppointmentSlotsRequest $body  The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateSelfShipAppointmentSlotsResponse
     */
    public function generateSelfShipAppointmentSlots(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->generateSelfShipAppointmentSlotsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateSelfShipAppointmentSlots',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateSelfShipAppointmentSlots'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateSelfShipAppointmentSlots',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateSelfShipAppointmentSlotsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generateSelfShipAppointmentSlots'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateSelfShipAppointmentSlotsRequest $body  The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generateSelfShipAppointmentSlotsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateSelfShipAppointmentSlots'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateSelfShipAppointmentSlots'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.generateSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling generateSelfShipAppointmentSlots'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generateShipmentContentUpdatePreviews
     *
     * generateShipmentContentUpdatePreviews
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateShipmentContentUpdatePreviewsRequest $body  The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateShipmentContentUpdatePreviewsResponse
     */
    public function generateShipmentContentUpdatePreviews(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->generateShipmentContentUpdatePreviewsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateShipmentContentUpdatePreviews',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateShipmentContentUpdatePreviews'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateShipmentContentUpdatePreviews',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateShipmentContentUpdatePreviewsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generateShipmentContentUpdatePreviews'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateShipmentContentUpdatePreviewsRequest $body  The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generateShipmentContentUpdatePreviewsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateShipmentContentUpdatePreviews'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateShipmentContentUpdatePreviews'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.generateShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling generateShipmentContentUpdatePreviews'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation generateTransportationOptions
     *
     * generateTransportationOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateTransportationOptionsRequest $body  The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateTransportationOptionsResponse
     */
    public function generateTransportationOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $body)
    {
        $request = $this->generateTransportationOptionsRequest($accessToken, $region, $inbound_plan_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'generateTransportationOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateTransportationOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateTransportationOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateTransportationOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'generateTransportationOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'generateTransportationOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'generateTransportationOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'generateTransportationOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateTransportationOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'generateTransportationOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GenerateTransportationOptionsRequest $body  The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function generateTransportationOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.generateTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.generateTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling generateTransportationOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getDeliveryChallanDocument
     *
     * getDeliveryChallanDocument
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GetDeliveryChallanDocumentResponse
     */
    public function getDeliveryChallanDocument(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id)
    {
        $request = $this->getDeliveryChallanDocumentRequest($accessToken, $region, $inbound_plan_id, $shipment_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getDeliveryChallanDocument', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getDeliveryChallanDocument')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getDeliveryChallanDocument'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getDeliveryChallanDocument',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getDeliveryChallanDocument', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getDeliveryChallanDocument')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getDeliveryChallanDocument'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getDeliveryChallanDocument',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GetDeliveryChallanDocumentResponse',
            []
        );
    }

    /**
     * Create request for operation 'getDeliveryChallanDocument'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getDeliveryChallanDocumentRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getDeliveryChallanDocument'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getDeliveryChallanDocument'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.getDeliveryChallanDocument, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryChallanDocument';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getInboundOperationStatus
     *
     * getInboundOperationStatus
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $operation_id  Identifier of an asynchronous operation. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\InboundOperationStatus
     */
    public function getInboundOperationStatus(AccessToken $accessToken, string $region, $operation_id)
    {
        $request = $this->getInboundOperationStatusRequest($accessToken, $region, $operation_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getInboundOperationStatus', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getInboundOperationStatus')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getInboundOperationStatus'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getInboundOperationStatus',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getInboundOperationStatus', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getInboundOperationStatus')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getInboundOperationStatus'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getInboundOperationStatus',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\InboundOperationStatus',
            []
        );
    }

    /**
     * Create request for operation 'getInboundOperationStatus'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $operation_id  Identifier of an asynchronous operation. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getInboundOperationStatusRequest(AccessToken $accessToken, string $region, $operation_id) : RequestInterface
    {
        // verify the required parameter 'operation_id' is set
        if ($operation_id === null || (is_array($operation_id) && count($operation_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $operation_id when calling getInboundOperationStatus'
            );
        }
        if (strlen($operation_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$operation_id" when calling FulfillmentInboundApi.getInboundOperationStatus, must be smaller than or equal to 38.');
        }
        if (strlen($operation_id) < 36) {
            throw new InvalidArgumentException('invalid length for "$operation_id" when calling FulfillmentInboundApi.getInboundOperationStatus, must be bigger than or equal to 36.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $operation_id)) {
            throw new InvalidArgumentException("invalid value for \"operation_id\" when calling FulfillmentInboundApi.getInboundOperationStatus, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/operations/{operationId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($operation_id !== null) {
            $resourcePath = str_replace(
                '{' . 'operationId' . '}',
                ObjectSerializer::toPathValue($operation_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getInboundPlan
     *
     * getInboundPlan
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\InboundPlan
     */
    public function getInboundPlan(AccessToken $accessToken, string $region, $inbound_plan_id)
    {
        $request = $this->getInboundPlanRequest($accessToken, $region, $inbound_plan_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getInboundPlan', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getInboundPlan')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getInboundPlan'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getInboundPlan',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getInboundPlan', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getInboundPlan')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getInboundPlan'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getInboundPlan',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\InboundPlan',
            []
        );
    }

    /**
     * Create request for operation 'getInboundPlan'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getInboundPlanRequest(AccessToken $accessToken, string $region, $inbound_plan_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getInboundPlan'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getInboundPlan, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getInboundPlan, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.getInboundPlan, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getSelfShipAppointmentSlots
     *
     * getSelfShipAppointmentSlots
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GetSelfShipAppointmentSlotsResponse
     */
    public function getSelfShipAppointmentSlots(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->getSelfShipAppointmentSlotsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getSelfShipAppointmentSlots',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getSelfShipAppointmentSlots'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getSelfShipAppointmentSlots',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\GetSelfShipAppointmentSlotsResponse',
            []
        );
    }

    /**
     * Create request for operation 'getSelfShipAppointmentSlots'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getSelfShipAppointmentSlotsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getSelfShipAppointmentSlots'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getSelfShipAppointmentSlots'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 100) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 100.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getShipment
     *
     * getShipment
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\Shipment
     */
    public function getShipment(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id)
    {
        $request = $this->getShipmentRequest($accessToken, $region, $inbound_plan_id, $shipment_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getShipment', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getShipment')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getShipment'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getShipment',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getShipment', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getShipment')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getShipment'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getShipment',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\Shipment',
            []
        );
    }

    /**
     * Create request for operation 'getShipment'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getShipmentRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getShipment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getShipment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getShipment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.getShipment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getShipment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getShipment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getShipment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.getShipment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation getShipmentContentUpdatePreview
     *
     * getShipmentContentUpdatePreview
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id  Identifier of a content update preview. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ContentUpdatePreview
     */
    public function getShipmentContentUpdatePreview(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $content_update_preview_id)
    {
        $request = $this->getShipmentContentUpdatePreviewRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $content_update_preview_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getShipmentContentUpdatePreview',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'getShipmentContentUpdatePreview'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'getShipmentContentUpdatePreview',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ContentUpdatePreview',
            []
        );
    }

    /**
     * Create request for operation 'getShipmentContentUpdatePreview'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id  Identifier of a content update preview. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function getShipmentContentUpdatePreviewRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $content_update_preview_id) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'content_update_preview_id' is set
        if ($content_update_preview_id === null || (is_array($content_update_preview_id) && count($content_update_preview_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $content_update_preview_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($content_update_preview_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($content_update_preview_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $content_update_preview_id)) {
            throw new InvalidArgumentException("invalid value for \"content_update_preview_id\" when calling FulfillmentInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if ($content_update_preview_id !== null) {
            $resourcePath = str_replace(
                '{' . 'contentUpdatePreviewId' . '}',
                ObjectSerializer::toPathValue($content_update_preview_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listDeliveryWindowOptions
     *
     * listDeliveryWindowOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to get delivery window options for. (required)
     * @param int $page_size  The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListDeliveryWindowOptionsResponse
     */
    public function listDeliveryWindowOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listDeliveryWindowOptionsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listDeliveryWindowOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listDeliveryWindowOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listDeliveryWindowOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listDeliveryWindowOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listDeliveryWindowOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listDeliveryWindowOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listDeliveryWindowOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listDeliveryWindowOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListDeliveryWindowOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listDeliveryWindowOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  The shipment to get delivery window options for. (required)
     * @param int $page_size  The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listDeliveryWindowOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 100) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 100.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listInboundPlanBoxes
     *
     * listInboundPlanBoxes
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanBoxesResponse
     */
    public function listInboundPlanBoxes(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listInboundPlanBoxesRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listInboundPlanBoxes', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanBoxes')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanBoxes'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanBoxes',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listInboundPlanBoxes', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanBoxes')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanBoxes'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanBoxes',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanBoxesResponse',
            []
        );
    }

    /**
     * Create request for operation 'listInboundPlanBoxes'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listInboundPlanBoxesRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listInboundPlanBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanBoxes, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listInboundPlanItems
     *
     * listInboundPlanItems
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanItemsResponse
     */
    public function listInboundPlanItems(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listInboundPlanItemsRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listInboundPlanItems', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanItems')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanItems'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanItems',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listInboundPlanItems', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanItems')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanItems'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanItems',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanItemsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listInboundPlanItems'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listInboundPlanItemsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanItems, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listInboundPlanItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanItems, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanItems, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanItems, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanItems, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listInboundPlanPallets
     *
     * listInboundPlanPallets
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanPalletsResponse
     */
    public function listInboundPlanPallets(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listInboundPlanPalletsRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listInboundPlanPallets', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanPallets')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanPallets'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanPallets',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listInboundPlanPallets', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlanPallets')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlanPallets'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlanPallets',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlanPalletsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listInboundPlanPallets'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listInboundPlanPalletsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanPallets'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanPallets, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listInboundPlanPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listInboundPlanPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanPallets, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlanPallets, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanPallets, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlanPallets, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/pallets';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listInboundPlans
     *
     * listInboundPlans
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param int $page_size  The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param string|null $status  The status of an inbound plan. (optional)
     * @param string|null $sort_by  Sort by field. (optional)
     * @param string|null $sort_order  The sort order. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlansResponse
     */
    public function listInboundPlans(AccessToken $accessToken, string $region, $page_size = 10, $pagination_token = null, $status = null, $sort_by = null, $sort_order = null)
    {
        $request = $this->listInboundPlansRequest($accessToken, $region, $page_size, $pagination_token, $status, $sort_by, $sort_order);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listInboundPlans', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlans')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlans'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlans',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listInboundPlans', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listInboundPlans')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listInboundPlans'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listInboundPlans',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListInboundPlansResponse',
            []
        );
    }

    /**
     * Create request for operation 'listInboundPlans'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param int $page_size  The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param string|null $status  The status of an inbound plan. (optional)
     * @param string|null $sort_by  Sort by field. (optional)
     * @param string|null $sort_order  The sort order. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listInboundPlansRequest(AccessToken $accessToken, string $region, $page_size = 10, $pagination_token = null, $status = null, $sort_by = null, $sort_order = null) : RequestInterface
    {
        if ($page_size !== null && $page_size > 30) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlans, must be smaller than or equal to 30.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listInboundPlans, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlans, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listInboundPlans, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }
        // query params
        if (is_array($status)) {
            $status = ObjectSerializer::serializeCollection($status, '', true);
        }
        if ($status !== null) {
            $queryParams['status'] = ObjectSerializer::toString($status);
        }
        // query params
        if (is_array($sort_by)) {
            $sort_by = ObjectSerializer::serializeCollection($sort_by, '', true);
        }
        if ($sort_by !== null) {
            $queryParams['sortBy'] = ObjectSerializer::toString($sort_by);
        }
        // query params
        if (is_array($sort_order)) {
            $sort_order = ObjectSerializer::serializeCollection($sort_order, '', true);
        }
        if ($sort_order !== null) {
            $queryParams['sortOrder'] = ObjectSerializer::toString($sort_order);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listItemComplianceDetails
     *
     * listItemComplianceDetails
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string[] $mskus  A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string $marketplace_id  The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListItemComplianceDetailsResponse
     */
    public function listItemComplianceDetails(AccessToken $accessToken, string $region, $mskus, $marketplace_id)
    {
        $request = $this->listItemComplianceDetailsRequest($accessToken, $region, $mskus, $marketplace_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listItemComplianceDetails', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listItemComplianceDetails')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listItemComplianceDetails'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listItemComplianceDetails',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listItemComplianceDetails', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listItemComplianceDetails')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listItemComplianceDetails'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listItemComplianceDetails',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListItemComplianceDetailsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listItemComplianceDetails'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string[] $mskus  A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string $marketplace_id  The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listItemComplianceDetailsRequest(AccessToken $accessToken, string $region, $mskus, $marketplace_id) : RequestInterface
    {
        // verify the required parameter 'mskus' is set
        if ($mskus === null || (is_array($mskus) && count($mskus) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $mskus when calling listItemComplianceDetails'
            );
        }
        if (count($mskus) > 100) {
            throw new InvalidArgumentException('invalid value for "$mskus" when calling FulfillmentInboundApi.listItemComplianceDetails, number of items must be less than or equal to 100.');
        }
        if (count($mskus) < 1) {
            throw new InvalidArgumentException('invalid value for "$mskus" when calling FulfillmentInboundApi.listItemComplianceDetails, number of items must be greater than or equal to 1.');
        }

        // verify the required parameter 'marketplace_id' is set
        if ($marketplace_id === null || (is_array($marketplace_id) && count($marketplace_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling listItemComplianceDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.listItemComplianceDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.listItemComplianceDetails, must be bigger than or equal to 1.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/items/compliance';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if ($mskus !== null) {
            if('form' === 'form' && is_array($mskus)) {
                foreach($mskus as $key => $value) {
                    $queryParams[$key] = $value;
                }
            }
            else {
                $queryParams['mskus'] = $mskus;
            }
        }
        // query params
        if (is_array($marketplace_id)) {
            $marketplace_id = ObjectSerializer::serializeCollection($marketplace_id, '', true);
        }
        if ($marketplace_id !== null) {
            $queryParams['marketplaceId'] = ObjectSerializer::toString($marketplace_id);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listPackingGroupBoxes
     *
     * listPackingGroupBoxes
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_group_id  Identifier of a packing group. (required)
     * @param int $page_size  The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingGroupBoxesResponse
     */
    public function listPackingGroupBoxes(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_group_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listPackingGroupBoxesRequest($accessToken, $region, $inbound_plan_id, $packing_group_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listPackingGroupBoxes', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingGroupBoxes')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingGroupBoxes'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingGroupBoxes',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listPackingGroupBoxes', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingGroupBoxes')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingGroupBoxes'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingGroupBoxes',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingGroupBoxesResponse',
            []
        );
    }

    /**
     * Create request for operation 'listPackingGroupBoxes'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_group_id  Identifier of a packing group. (required)
     * @param int $page_size  The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listPackingGroupBoxesRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_group_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingGroupBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listPackingGroupBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'packing_group_id' is set
        if ($packing_group_id === null || (is_array($packing_group_id) && count($packing_group_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $packing_group_id when calling listPackingGroupBoxes'
            );
        }
        if (strlen($packing_group_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$packing_group_id" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($packing_group_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$packing_group_id" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $packing_group_id)) {
            throw new InvalidArgumentException("invalid value for \"packing_group_id\" when calling FulfillmentInboundApi.listPackingGroupBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 100) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be smaller than or equal to 100.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingGroupBoxes, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingGroups/{packingGroupId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($packing_group_id !== null) {
            $resourcePath = str_replace(
                '{' . 'packingGroupId' . '}',
                ObjectSerializer::toPathValue($packing_group_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listPackingGroupItems
     *
     * listPackingGroupItems
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_group_id  Identifier of a packing group. (required)
     * @param int $page_size  The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingGroupItemsResponse
     */
    public function listPackingGroupItems(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_group_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listPackingGroupItemsRequest($accessToken, $region, $inbound_plan_id, $packing_group_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listPackingGroupItems', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingGroupItems')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingGroupItems'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingGroupItems',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listPackingGroupItems', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingGroupItems')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingGroupItems'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingGroupItems',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingGroupItemsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listPackingGroupItems'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $packing_group_id  Identifier of a packing group. (required)
     * @param int $page_size  The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listPackingGroupItemsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $packing_group_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingGroupItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingGroupItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingGroupItems, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listPackingGroupItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'packing_group_id' is set
        if ($packing_group_id === null || (is_array($packing_group_id) && count($packing_group_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $packing_group_id when calling listPackingGroupItems'
            );
        }
        if (strlen($packing_group_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$packing_group_id" when calling FulfillmentInboundApi.listPackingGroupItems, must be smaller than or equal to 38.');
        }
        if (strlen($packing_group_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$packing_group_id" when calling FulfillmentInboundApi.listPackingGroupItems, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $packing_group_id)) {
            throw new InvalidArgumentException("invalid value for \"packing_group_id\" when calling FulfillmentInboundApi.listPackingGroupItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 100) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingGroupItems, must be smaller than or equal to 100.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingGroupItems, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingGroupItems, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingGroupItems, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingGroups/{packingGroupId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($packing_group_id !== null) {
            $resourcePath = str_replace(
                '{' . 'packingGroupId' . '}',
                ObjectSerializer::toPathValue($packing_group_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listPackingOptions
     *
     * listPackingOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingOptionsResponse
     */
    public function listPackingOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listPackingOptionsRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listPackingOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listPackingOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPackingOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPackingOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPackingOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPackingOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listPackingOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listPackingOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPackingOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listPackingOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 20) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingOptions, must be smaller than or equal to 20.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPackingOptions, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingOptions, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPackingOptions, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listPlacementOptions
     *
     * listPlacementOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPlacementOptionsResponse
     */
    public function listPlacementOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listPlacementOptionsRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listPlacementOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPlacementOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPlacementOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPlacementOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listPlacementOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPlacementOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPlacementOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPlacementOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPlacementOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listPlacementOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listPlacementOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPlacementOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPlacementOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listPlacementOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listPlacementOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 20) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPlacementOptions, must be smaller than or equal to 20.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listPlacementOptions, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPlacementOptions, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listPlacementOptions, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listPrepDetails
     *
     * listPrepDetails
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $marketplace_id  The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[] $mskus  A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPrepDetailsResponse
     */
    public function listPrepDetails(AccessToken $accessToken, string $region, $marketplace_id, $mskus)
    {
        $request = $this->listPrepDetailsRequest($accessToken, $region, $marketplace_id, $mskus);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listPrepDetails', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPrepDetails')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPrepDetails'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPrepDetails',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listPrepDetails', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listPrepDetails')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listPrepDetails'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listPrepDetails',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListPrepDetailsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listPrepDetails'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $marketplace_id  The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[] $mskus  A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listPrepDetailsRequest(AccessToken $accessToken, string $region, $marketplace_id, $mskus) : RequestInterface
    {
        // verify the required parameter 'marketplace_id' is set
        if ($marketplace_id === null || (is_array($marketplace_id) && count($marketplace_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling listPrepDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.listPrepDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.listPrepDetails, must be bigger than or equal to 1.');
        }

        // verify the required parameter 'mskus' is set
        if ($mskus === null || (is_array($mskus) && count($mskus) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $mskus when calling listPrepDetails'
            );
        }
        if (count($mskus) > 100) {
            throw new InvalidArgumentException('invalid value for "$mskus" when calling FulfillmentInboundApi.listPrepDetails, number of items must be less than or equal to 100.');
        }
        if (count($mskus) < 1) {
            throw new InvalidArgumentException('invalid value for "$mskus" when calling FulfillmentInboundApi.listPrepDetails, number of items must be greater than or equal to 1.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/items/prepDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($marketplace_id)) {
            $marketplace_id = ObjectSerializer::serializeCollection($marketplace_id, '', true);
        }
        if ($marketplace_id !== null) {
            $queryParams['marketplaceId'] = ObjectSerializer::toString($marketplace_id);
        }
        // query params
        if ($mskus !== null) {
            if('form' === 'form' && is_array($mskus)) {
                foreach($mskus as $key => $value) {
                    $queryParams[$key] = $value;
                }
            }
            else {
                $queryParams['mskus'] = $mskus;
            }
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listShipmentBoxes
     *
     * listShipmentBoxes
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentBoxesResponse
     */
    public function listShipmentBoxes(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listShipmentBoxesRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listShipmentBoxes', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentBoxes')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentBoxes'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentBoxes',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listShipmentBoxes', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentBoxes')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentBoxes'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentBoxes',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentBoxesResponse',
            []
        );
    }

    /**
     * Create request for operation 'listShipmentBoxes'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listShipmentBoxesRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listShipmentBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentBoxes'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listShipmentBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentBoxes, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentBoxes, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentBoxes, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentBoxes, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listShipmentContentUpdatePreviews
     *
     * listShipmentContentUpdatePreviews
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of content update previews to return. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentContentUpdatePreviewsResponse
     */
    public function listShipmentContentUpdatePreviews(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listShipmentContentUpdatePreviewsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentContentUpdatePreviews',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentContentUpdatePreviews'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentContentUpdatePreviews',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentContentUpdatePreviewsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listShipmentContentUpdatePreviews'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of content update previews to return. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listShipmentContentUpdatePreviewsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentContentUpdatePreviews'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentContentUpdatePreviews'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 20) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 20.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listShipmentItems
     *
     * listShipmentItems
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentItemsResponse
     */
    public function listShipmentItems(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listShipmentItemsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listShipmentItems', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentItems')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentItems'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentItems',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listShipmentItems', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentItems')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentItems'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentItems',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentItemsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listShipmentItems'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of items to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listShipmentItemsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentItems, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listShipmentItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentItems'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentItems, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentItems, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listShipmentItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentItems, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentItems, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentItems, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentItems, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listShipmentPallets
     *
     * listShipmentPallets
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentPalletsResponse
     */
    public function listShipmentPallets(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null)
    {
        $request = $this->listShipmentPalletsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $page_size, $pagination_token);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listShipmentPallets', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentPallets')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentPallets'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentPallets',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listShipmentPallets', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listShipmentPallets')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listShipmentPallets'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listShipmentPallets',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListShipmentPalletsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listShipmentPallets'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param int $page_size  The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listShipmentPalletsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $page_size = 10, $pagination_token = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentPallets'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentPallets, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listShipmentPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listShipmentPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentPallets'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentPallets, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listShipmentPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listShipmentPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 1000) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentPallets, must be smaller than or equal to 1000.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listShipmentPallets, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentPallets, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listShipmentPallets, must be bigger than or equal to 0.');
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/pallets';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation listTransportationOptions
     *
     * listTransportationOptions
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param string|null $placement_option_id  The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param string|null $shipment_id  The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListTransportationOptionsResponse
     */
    public function listTransportationOptions(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null, $placement_option_id = null, $shipment_id = null)
    {
        $request = $this->listTransportationOptionsRequest($accessToken, $region, $inbound_plan_id, $page_size, $pagination_token, $placement_option_id, $shipment_id);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'listTransportationOptions', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listTransportationOptions')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listTransportationOptions'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listTransportationOptions',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'listTransportationOptions', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'listTransportationOptions')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'listTransportationOptions'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'listTransportationOptions',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ListTransportationOptionsResponse',
            []
        );
    }

    /**
     * Create request for operation 'listTransportationOptions'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param int $page_size  The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param string|null $pagination_token  A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param string|null $placement_option_id  The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param string|null $shipment_id  The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function listTransportationOptionsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $page_size = 10, $pagination_token = null, $placement_option_id = null, $shipment_id = null) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($page_size !== null && $page_size > 20) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listTransportationOptions, must be smaller than or equal to 20.');
        }
        if ($page_size !== null && $page_size < 1) {
            throw new InvalidArgumentException('invalid value for "$page_size" when calling FulfillmentInboundApi.listTransportationOptions, must be bigger than or equal to 1.');
        }

        if ($pagination_token !== null && strlen($pagination_token) > 1024) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listTransportationOptions, must be smaller than or equal to 1024.');
        }
        if ($pagination_token !== null && strlen($pagination_token) < 0) {
            throw new InvalidArgumentException('invalid length for "$pagination_token" when calling FulfillmentInboundApi.listTransportationOptions, must be bigger than or equal to 0.');
        }

        if ($placement_option_id !== null && strlen($placement_option_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$placement_option_id" when calling FulfillmentInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if ($placement_option_id !== null && strlen($placement_option_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$placement_option_id" when calling FulfillmentInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if ($placement_option_id !== null && !preg_match("/^[a-zA-Z0-9-]*$/", $placement_option_id)) {
            throw new InvalidArgumentException("invalid value for \"placement_option_id\" when calling FulfillmentInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        if ($shipment_id !== null && strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if ($shipment_id !== null && strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if ($shipment_id !== null && !preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }


        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($page_size)) {
            $page_size = ObjectSerializer::serializeCollection($page_size, '', true);
        }
        if ($page_size !== null) {
            $queryParams['pageSize'] = ObjectSerializer::toString($page_size);
        }
        // query params
        if (is_array($pagination_token)) {
            $pagination_token = ObjectSerializer::serializeCollection($pagination_token, '', true);
        }
        if ($pagination_token !== null) {
            $queryParams['paginationToken'] = ObjectSerializer::toString($pagination_token);
        }
        // query params
        if (is_array($placement_option_id)) {
            $placement_option_id = ObjectSerializer::serializeCollection($placement_option_id, '', true);
        }
        if ($placement_option_id !== null) {
            $queryParams['placementOptionId'] = ObjectSerializer::toString($placement_option_id);
        }
        // query params
        if (is_array($shipment_id)) {
            $shipment_id = ObjectSerializer::serializeCollection($shipment_id, '', true);
        }
        if ($shipment_id !== null) {
            $queryParams['shipmentId'] = ObjectSerializer::toString($shipment_id);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'GET',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation scheduleSelfShipAppointment
     *
     * scheduleSelfShipAppointment
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $slot_id  An identifier to a self-ship appointment slot. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ScheduleSelfShipAppointmentRequest $body  The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ScheduleSelfShipAppointmentResponse
     */
    public function scheduleSelfShipAppointment(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $slot_id, $body)
    {
        $request = $this->scheduleSelfShipAppointmentRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $slot_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'scheduleSelfShipAppointment',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'scheduleSelfShipAppointment'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'scheduleSelfShipAppointment',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ScheduleSelfShipAppointmentResponse',
            []
        );
    }

    /**
     * Create request for operation 'scheduleSelfShipAppointment'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $slot_id  An identifier to a self-ship appointment slot. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\ScheduleSelfShipAppointmentRequest $body  The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function scheduleSelfShipAppointmentRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $slot_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'slot_id' is set
        if ($slot_id === null || (is_array($slot_id) && count($slot_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $slot_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($slot_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$slot_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($slot_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$slot_id" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $slot_id)) {
            throw new InvalidArgumentException("invalid value for \"slot_id\" when calling FulfillmentInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling scheduleSelfShipAppointment'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots/{slotId}/schedule';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if ($slot_id !== null) {
            $resourcePath = str_replace(
                '{' . 'slotId' . '}',
                ObjectSerializer::toPathValue($slot_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation setPackingInformation
     *
     * setPackingInformation
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPackingInformationRequest $body  The body of the request to &#x60;setPackingInformation&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPackingInformationResponse
     */
    public function setPackingInformation(AccessToken $accessToken, string $region, $inbound_plan_id, $body)
    {
        $request = $this->setPackingInformationRequest($accessToken, $region, $inbound_plan_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'setPackingInformation', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'setPackingInformation')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'setPackingInformation'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'setPackingInformation',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'setPackingInformation', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'setPackingInformation')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'setPackingInformation'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'setPackingInformation',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPackingInformationResponse',
            []
        );
    }

    /**
     * Create request for operation 'setPackingInformation'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPackingInformationRequest $body  The body of the request to &#x60;setPackingInformation&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function setPackingInformationRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling setPackingInformation'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.setPackingInformation, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.setPackingInformation, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.setPackingInformation, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling setPackingInformation'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingInformation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation setPrepDetails
     *
     * setPrepDetails
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPrepDetailsRequest $body  The body of the request to &#x60;setPrepDetails&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPrepDetailsResponse
     */
    public function setPrepDetails(AccessToken $accessToken, string $region, $body)
    {
        $request = $this->setPrepDetailsRequest($accessToken, $region, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'setPrepDetails', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'setPrepDetails')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'setPrepDetails'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'setPrepDetails',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'setPrepDetails', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'setPrepDetails')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'setPrepDetails'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'setPrepDetails',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPrepDetailsResponse',
            []
        );
    }

    /**
     * Create request for operation 'setPrepDetails'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\SetPrepDetailsRequest $body  The body of the request to &#x60;setPrepDetails&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function setPrepDetailsRequest(AccessToken $accessToken, string $region, $body) : RequestInterface
    {
        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling setPrepDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/prepDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'POST',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation updateInboundPlanName
     *
     * updateInboundPlanName
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateInboundPlanNameRequest $body  The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return null
     */
    public function updateInboundPlanName(AccessToken $accessToken, string $region, $inbound_plan_id, $body)
    {
        $request = $this->updateInboundPlanNameRequest($accessToken, $region, $inbound_plan_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'updateInboundPlanName', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateInboundPlanName')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateInboundPlanName'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateInboundPlanName',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'updateInboundPlanName', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateInboundPlanName')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateInboundPlanName'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateInboundPlanName',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return null;
    }

    /**
     * Create request for operation 'updateInboundPlanName'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateInboundPlanNameRequest $body  The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function updateInboundPlanNameRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateInboundPlanName'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateInboundPlanName, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateInboundPlanName, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.updateInboundPlanName, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling updateInboundPlanName'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/name';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation updateItemComplianceDetails
     *
     * updateItemComplianceDetails
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $marketplace_id  The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateItemComplianceDetailsRequest $body  The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateItemComplianceDetailsResponse
     */
    public function updateItemComplianceDetails(AccessToken $accessToken, string $region, $marketplace_id, $body)
    {
        $request = $this->updateItemComplianceDetailsRequest($accessToken, $region, $marketplace_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'updateItemComplianceDetails', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateItemComplianceDetails')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateItemComplianceDetails'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateItemComplianceDetails',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'updateItemComplianceDetails', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateItemComplianceDetails')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateItemComplianceDetails'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateItemComplianceDetails',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateItemComplianceDetailsResponse',
            []
        );
    }

    /**
     * Create request for operation 'updateItemComplianceDetails'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $marketplace_id  The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateItemComplianceDetailsRequest $body  The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function updateItemComplianceDetailsRequest(AccessToken $accessToken, string $region, $marketplace_id, $body) : RequestInterface
    {
        // verify the required parameter 'marketplace_id' is set
        if ($marketplace_id === null || (is_array($marketplace_id) && count($marketplace_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling updateItemComplianceDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.updateItemComplianceDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new InvalidArgumentException('invalid length for "$marketplace_id" when calling FulfillmentInboundApi.updateItemComplianceDetails, must be bigger than or equal to 1.');
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling updateItemComplianceDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/compliance';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';

        // query params
        if (is_array($marketplace_id)) {
            $marketplace_id = ObjectSerializer::serializeCollection($marketplace_id, '', true);
        }
        if ($marketplace_id !== null) {
            $queryParams['marketplaceId'] = ObjectSerializer::toString($marketplace_id);
        }

        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }




        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation updateShipmentName
     *
     * updateShipmentName
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentNameRequest $body  The body of the request to &#x60;updateShipmentName&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return null
     */
    public function updateShipmentName(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->updateShipmentNameRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'updateShipmentName', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentName')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentName'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentName',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'updateShipmentName', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentName')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentName'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentName',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return null;
    }

    /**
     * Create request for operation 'updateShipmentName'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentNameRequest $body  The body of the request to &#x60;updateShipmentName&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function updateShipmentNameRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentName'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentName, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentName, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.updateShipmentName, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentName'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentName, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentName, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.updateShipmentName, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentName'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/name';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation updateShipmentSourceAddress
     *
     * updateShipmentSourceAddress
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentSourceAddressRequest $body  The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentSourceAddressResponse
     */
    public function updateShipmentSourceAddress(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->updateShipmentSourceAddressRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'updateShipmentSourceAddress', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentSourceAddress')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentSourceAddress'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentSourceAddress',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'updateShipmentSourceAddress', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentSourceAddress')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentSourceAddress'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentSourceAddress',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentSourceAddressResponse',
            []
        );
    }

    /**
     * Create request for operation 'updateShipmentSourceAddress'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentSourceAddressRequest $body  The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function updateShipmentSourceAddressRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentSourceAddress'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentSourceAddress'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.updateShipmentSourceAddress, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentSourceAddress'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/sourceAddress';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

    /**
     * Operation updateShipmentTrackingDetails
     *
     * updateShipmentTrackingDetails
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentTrackingDetailsRequest $body  The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     *
     * @throws ApiException on non-2xx response
     * @throws InvalidArgumentException
     * @return \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentTrackingDetailsResponse
     */
    public function updateShipmentTrackingDetails(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body)
    {
        $request = $this->updateShipmentTrackingDetailsRequest($accessToken, $region, $inbound_plan_id, $shipment_id, $body);

        $this->configuration->extensions()->preRequest('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails', $request);

        try {
            $correlationId = \uuid_create(UUID_TYPE_RANDOM);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails')) {

                $sanitizedRequest = $request;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails'),
                    'Amazon Selling Partner API pre request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentTrackingDetails',
                        'request_correlation_id' => $correlationId,
                        'request_body' => (string) $sanitizedRequest->getBody(),
                        'request_headers' => $sanitizedRequest->getHeaders(),
                        'request_uri' => (string) $sanitizedRequest->getUri(),
                    ]
                );
            }

            $response = $this->client->sendRequest($request);

            $this->configuration->extensions()->postRequest('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails', $request, $response);

            if ($this->configuration->loggingEnabled('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails')) {

                $sanitizedResponse = $response;

                foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
                    $sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
                }

                $this->logger->log(
                    $this->configuration->logLevel('FulfillmentInboundV20240320', 'updateShipmentTrackingDetails'),
                    'Amazon Selling Partner API post request',
                    [
                        'api' => 'FulfillmentInboundV20240320',
                        'operation' => 'updateShipmentTrackingDetails',
                        'response_correlation_id' => $correlationId,
                        'response_body' => (string) $sanitizedResponse->getBody(),
                        'response_headers' => $sanitizedResponse->getHeaders(),
                        'response_status_code' => $sanitizedResponse->getStatusCode(),
                    ]
                );
            }
        } catch (ClientExceptionInterface $e) {
            throw new ApiException(
                "[{$e->getCode()}] {$e->getMessage()}",
                (int) $e->getCode(),
                null,
                null,
                $e
            );
        }

        $statusCode = $response->getStatusCode();

        if ($statusCode < 200 || $statusCode > 299) {
            throw new ApiException(
                sprintf(
                    '[%d] Error connecting to the API (%s)',
                    $statusCode,
                    (string) $request->getUri()
                ),
                $statusCode,
                $response->getHeaders(),
                (string) $response->getBody()
            );
        }

        return ObjectSerializer::deserialize(
            $this->configuration,
            (string) $response->getBody(),
            '\AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentTrackingDetailsResponse',
            []
        );
    }

    /**
     * Create request for operation 'updateShipmentTrackingDetails'
     *
     * @param AccessToken $accessToken
     * @param string $region
     * @param string $inbound_plan_id  Identifier of an inbound plan. (required)
     * @param string $shipment_id  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param \AmazonPHP\SellingPartner\Model\FulfillmentInboundV20240320\UpdateShipmentTrackingDetailsRequest $body  The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     *
     * @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
     * @return \Psr\Http\Message\RequestInterface
     */
    public function updateShipmentTrackingDetailsRequest(AccessToken $accessToken, string $region, $inbound_plan_id, $shipment_id, $body) : RequestInterface
    {
        // verify the required parameter 'inbound_plan_id' is set
        if ($inbound_plan_id === null || (is_array($inbound_plan_id) && count($inbound_plan_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentTrackingDetails'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $inbound_plan_id)) {
            throw new InvalidArgumentException("invalid value for \"inbound_plan_id\" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'shipment_id' is set
        if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentTrackingDetails'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new InvalidArgumentException('invalid length for "$shipment_id" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must be bigger than or equal to 38.');
        }
        if (!preg_match("/^[a-zA-Z0-9-]*$/", $shipment_id)) {
            throw new InvalidArgumentException("invalid value for \"shipment_id\" when calling FulfillmentInboundApi.updateShipmentTrackingDetails, must conform to the pattern /^[a-zA-Z0-9-]*$/.");
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentTrackingDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/trackingDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $multipart = false;
        $query = '';


        if (\count($queryParams)) {
            $query = http_build_query($queryParams);
        }


        // path params
        if ($inbound_plan_id !== null) {
            $resourcePath = str_replace(
                '{' . 'inboundPlanId' . '}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if ($shipment_id !== null) {
            $resourcePath = str_replace(
                '{' . 'shipmentId' . '}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }


        if ($multipart) {
            $headers = [
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        } else {
            $headers = [
                'content-type' => ['application/json'],
                'accept' => ['application/json'],
                'host' => [$this->configuration->apiHost($region)],
                'user-agent' => [$this->configuration->userAgent()],
            ];
        }

        $request = $this->httpFactory->createRequest(
            'PUT',
            $this->configuration->apiURL($region) . $resourcePath . '?' . $query
        );

        // for model (json/xml)
        if (isset($body)) {
            if ($headers['content-type'] === ['application/json']) {
                $httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }

            $request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                $request = $request->withParsedBody($multipartContents);
            } elseif ($headers['content-type'] === ['application/json']) {
                $request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams)));
            } else {
                $request = $request->withParsedBody($formParams);
            }
        }

        foreach (\array_merge($headerParams, $headers) as $name => $header) {
            $request = $request->withHeader($name, $header);
        }

        return HttpSignatureHeaders::forConfig(
            $this->configuration,
            $accessToken,
            $region,
            $request
        );
    }

}
